﻿using System;
using System.Collections.Generic;
using UnityEngine;

namespace H
{
	// Token: 0x0200025E RID: 606
	internal class H_State_InEjaIn : H_State
	{
		// Token: 0x06000FFE RID: 4094 RVA: 0x00066C90 File Offset: 0x00064E90
		public H_State_InEjaIn(H_Members members) : base(members)
		{
		}

		// Token: 0x06000FFF RID: 4095 RVA: 0x00066CA4 File Offset: 0x00064EA4
		public override void In(H_State.Message msg)
		{
			this.members.param.continuanceXTC_F = 0;
			this.members.AddCountXTC();
			this.members.param.manyEjaculation = (this.members.MaleGageVal >= 1f);
			this.members.PlayAnime("InEja_In", 0.2f);
			this.members.VoiceExpression(H_Voice.TYPE.XTC_M);
			this.members.MaleExpression(H_Expression_Male.TYPE.EJACULATION);
			this.ejaculated = false;
			this.timer = 0f;
		}

		// Token: 0x06001000 RID: 4096 RVA: 0x00066D34 File Offset: 0x00064F34
		public override void Main()
		{
			if (!this.ejaculated && this.timer >= this.ejaculationDelay)
			{
				this.Ejaculation();
			}
			else
			{
				this.timer += Time.deltaTime;
			}
			if (this.members.CheckEndAnime("InEja_In"))
			{
				if (!this.ejaculated)
				{
					this.Ejaculation();
				}
				base.ChangeState(H_STATE.IN_EJA_TREMBLE, null);
			}
		}

		// Token: 0x06001001 RID: 4097 RVA: 0x00066DA8 File Offset: 0x00064FA8
		private void Ejaculation()
		{
			List<Male> males = this.members.GetMales();
			int noInsMale = this.members.StyleData.noInsMale;
			for (int i = 0; i < males.Count; i++)
			{
				if ((noInsMale & 1 << i) != 0)
				{
					males[i].Ejaculation(this.members.param.manyEjaculation);
				}
			}
			this.members.MaleGageVal = 0f;
			this.ejaculated = true;
		}

		// Token: 0x06001002 RID: 4098 RVA: 0x00066E2C File Offset: 0x0006502C
		public override void Out()
		{
		}

		// Token: 0x0400115A RID: 4442
		private bool ejaculated;

		// Token: 0x0400115B RID: 4443
		private float ejaculationDelay = 0.5f;

		// Token: 0x0400115C RID: 4444
		private float timer;
	}
}
